package com.corpgovernment.travelstandard.enums;

import java.util.Objects;

/**
 * 产线枚举 for 差标RC
 * @author yuxing zhang
 * @date 2024/2/21 10:35
 */
public enum ProductTravelStandardRCEnum {
    //国内机票
    FLIGHT_TS_RC(1,"国内机票","F"),
    //火车
    TRAIN_TS_RC(2, "火车票", "T"),
    //酒店
    HOTEL_TS_RC(3, "酒店", "H"),
    //国内打车
    CAR_TS_RC(4, "用车", "C"),
    //国际机票
    INTL_FLIGHT_TS_RC(5,"国际机票","IF"),
    //接送机
    AIRPORT_TRANSFER_TS_RC(7, "接送机", "AT"),
    //接送站
    TRAIN_TRANSFER_TS_RC(8, "接送站", "TT");

    /**
     * 产线类型
     */
    private Integer productCode;
    /**
     *  产线名称
     */
    private String productName;

    /**
     * 数据库RC表中的tsType
     */
    private String tsType;

    ProductTravelStandardRCEnum(Integer productCode, String productName, String tsType) {
        this.productCode = productCode;
        this.productName = productName;
        this.tsType = tsType;
    }

    public static ProductTravelStandardRCEnum getByProductCode(Integer productCode){
        if (Objects.isNull(productCode)){
            return null;
        }
        for (ProductTravelStandardRCEnum value : ProductTravelStandardRCEnum.values()) {
            if (value.productCode.equals(productCode)){
                return value;
            }
        }
        return null;
    }

    public Integer getProductCode() {
        return productCode;
    }

    public String getProductName() {
        return productName;
    }

    public String getTsType() {
        return tsType;
    }
}
